﻿CREATE TABLE [dbo].[Templates]
(
	[Key]			[VARCHAR](256)		NOT NULL,
	[TenantId]		[BIGINT]			NULL,
	[CustomData]	[XML]				NOT NULL,
	[CreatedAt]		[DATETIME]			NOT NULL,
	CONSTRAINT PK_Templates PRIMARY KEY ([Key]),
	CONSTRAINT FK_Templates_Tenants FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Tenants]([Id])
)